import React from 'react';
import { MaterialIcons } from 'taro-icons';
import { View, Text } from '@tarojs/components';

import './emptyContent.scss';

/**
 * 空内容展示组件
 * @param {EmptyContentProps} props - 组件属性
 * @returns {JSX.Element} 渲染的空内容展示组件
 */
export const EmptyContent: React.FC<{title: string}> = ({ 
    title
}) => {
    if (!title) {
        return <></>;
    }
    return (
        <View className="empty-state">
            <MaterialIcons name="hourglass-empty" color="#CECECE" size={24}/>
            <Text className="empty-text">{title}</Text>
        </View>
    );
};

export default EmptyContent;
